<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link href="https://cdn.bootcdn.net/ajax/libs/animate.css/2.0/animate.min.css" rel="stylesheet">
  <script src="vue.min.js"></script>
  <style>
    .fade-enter, .fade-leave-to {
    transform: translateY(-100%);
    }
    .fade-enter-active,
    .fade-leave-active {
      transition: all .6s;
    }

    .down-enter, .down-leave-to {
    transform: translateY(-200%);
    }
    .down-enter-active,
    .down-leave-active {
    transition: all .6s;
    }
    #app{
      overflow: hidden;
    }
    .isshow{
      width: 300px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      background-color: rgba(0, 0, 0, .2);
    }
  </style>
</head>

<body>
  <div id="app">
    <transition name="fade" 
    appear 
    enter-active-class="fade-enter-active"
    leave-active-class="fade-leave-active" 
    appear-active-class="animated swing"
>
      <div v-if="show" class="isshow">hello world</div>
    </transition>

   <!--  <transition name="down" appear enter-active-class="down-enter-active" leave-active-class="down-leave-active"
      appear-active-class="animated swing">
      <div v-if="!show" class="isshow">hello world1111</div>
    </transition>
     -->
    <button @click="handleClick" style="position: fixed;top: 50%;left: 50%;">toggle</button>
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        show:false
      },
      methods: {
        handleClick(){
          this.show=!this.show
        }
      }
    });
  </script>
</body>

</html>